package site.lyweb.domain.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;

/**
 * 
 * @TableName teacher
 */
@Data
public class StudentCourse implements Serializable {

    //student_course_relation表的id
    @TableId
    private String id;

    //student表的几个字段
    private String studentName;

    private Integer studentAge;

    private String studentPhone;

    //course表的几个字段
    private String courseName;

    private BigDecimal courseCredits;

    //teacher表的几个字段
    private String teacherName;

    private Integer teacherAge;

    private String teacherProfession;

    private BigDecimal courseScore;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        StudentCourse that = (StudentCourse) o;
        return Objects.equals(id, that.id) && Objects.equals(studentName, that.studentName) && Objects.equals(studentAge, that.studentAge) && Objects.equals(studentPhone, that.studentPhone) && Objects.equals(courseName, that.courseName) && Objects.equals(courseCredits, that.courseCredits) && Objects.equals(teacherName, that.teacherName) && Objects.equals(teacherAge, that.teacherAge) && Objects.equals(teacherProfession, that.teacherProfession);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, studentName, studentAge, studentPhone, courseName, courseCredits, teacherName, teacherAge, teacherProfession);
    }

    @Override
    public String toString() {
        return "StudentCourse{" +
                "id='" + id + '\'' +
                ", studentName='" + studentName + '\'' +
                ", studentAge=" + studentAge +
                ", studentPhone='" + studentPhone + '\'' +
                ", courseName='" + courseName + '\'' +
                ", courseCredits=" + courseCredits +
                ", teacherName='" + teacherName + '\'' +
                ", teacherAge=" + teacherAge +
                ", teacherProfession='" + teacherProfession + '\'' +
                '}';
    }
}